CC = g++ 

FLAGS = -g -std=c++11 -O0 -fno-strict-aliasing -Wno-write-strings -frtti -fexceptions -Wall
#FLAGS = -O0

LIBS = -lm -ldl -lssl -lpthread -lboost_thread -lcrypto -lrt -lpthread -L/usr/lib64/mysql -lmysqlclient ../libs/libjson_linux-gcc-4.4.7_libmt.a ../libs/libmysqlcppconn-static.a ../libs/libev.a ../libs/libhiredis.a
INC = -I ./  -I ../libs_header/
SRCS = $(wildcard *.cpp com/*.cpp)

OBJ_DIR = ../obj

OBJS = $(patsubst %.cpp, $(OBJ_DIR)/%.o, $(notdir ${SRCS}))

TARGET = yxj_robot

a: buildDir ../bin/yxj_robot

../bin/yxj_robot:$(OBJS)
	$(CC) -o $@ $^ $(LIBS)

$(OBJ_DIR)/%.o:%.cpp
	$(CC) -c $(FLAGS) $(INC) $< -o $@

buildDir:
	test -d ../obj || mkdir -p ../obj
	test -d ../bin || mkdir -p ../bin
c:
	-rm -f $(OBJ_DIR)/*.o


